package com.xiaoniu.forum.common.event;

import java.util.HashMap;
import java.util.Map;

/**
 *
 */
public class ForumEvent {
    private String triggerId;  //触发事件的用户id
    private String targetId;   //事件目标用户id
    private Integer action;     //事件行为   禁言、解除禁言、审核通过、审核不通过、关注、点赞、评论 等等
    private Map<String,Object> data; //事件数据,主要放的是一些其他类型的数据

    public String getTriggerId() {
        return triggerId;
    }

    public ForumEvent setTriggerId(String triggerId) {
        this.triggerId = triggerId;
        return this;
    }

    public String getTargetId() {
        return targetId;
    }

    public ForumEvent setTargetId(String targetId) {
        this.targetId = targetId;
        return this;
    }

    public Integer getAction() {
        return action;
    }

    public ForumEvent setAction(Integer action) {
        this.action = action;
        return this;
    }


    public Map<String, Object> getData() {
        return data;
    }

    public ForumEvent setData(String key,Object object) {
        if (data == null){
            data=new HashMap<>();
        }
        this.data.put(key,object);
        return this;
    }
}
